package com.alinesno.cloud.initializr.starter.gateway.dto;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 功能名： 项目构建参数 数据表： build_project_params
 * 
 * @author WeiXiaoJin
 * @date 2021-06-28 13:46:07
 */
public class BuildProjectParamsDto {

	private String id;
	// fields
	/**
	 * "项目Id"
	 */
	private String projectId;
	/**
	 * "构建类型"
	 */
	private String buildType;
	/**
	 * "构建场景"
	 */
	private String buildScene;
	/**
	 * "容器CPU限制"
	 */
	private String resourceLimitCpu;
	/**
	 * "容器内存限制"
	 */
	private String resourceLimitMem;
	/**
	 * "容器CPU请求"
	 */
	private String resourceRequestCpu;
	/**
	 * "容器内存请求"
	 */
	private String resourceRequestMem;
	/**
	 * "容器端口"
	 */
	private String containerPort;
	/**
	 * "容器参数"
	 */
	private String jsonParams;
	/**
	 * "服务监控"
	 */
	private String serviceMonitor;

	// getter and setter
	public String getProjectId()

	{
		return this.projectId;
	}

	public BuildProjectParamsDto setProjectId(String arg) {
		this.projectId = arg;
		return this;
	}

	public String getBuildType()

	{
		return this.buildType;
	}

	public BuildProjectParamsDto setBuildType(String arg) {
		this.buildType = arg;
		return this;
	}

	public String getBuildScene()

	{
		return this.buildScene;
	}

	public BuildProjectParamsDto setBuildScene(String arg) {
		this.buildScene = arg;
		return this;
	}

	public String getResourceLimitCpu()

	{
		return this.resourceLimitCpu;
	}

	public BuildProjectParamsDto setResourceLimitCpu(String arg) {
		this.resourceLimitCpu = arg;
		return this;
	}

	public String getResourceLimitMem()

	{
		return this.resourceLimitMem;
	}

	public BuildProjectParamsDto setResourceLimitMem(String arg) {
		this.resourceLimitMem = arg;
		return this;
	}

	public String getResourceRequestCpu()

	{
		return this.resourceRequestCpu;
	}

	public BuildProjectParamsDto setResourceRequestCpu(String arg) {
		this.resourceRequestCpu = arg;
		return this;
	}

	public String getResourceRequestMem()

	{
		return this.resourceRequestMem;
	}

	public BuildProjectParamsDto setResourceRequestMem(String arg) {
		this.resourceRequestMem = arg;
		return this;
	}

	public String getContainerPort()

	{
		return this.containerPort;
	}

	public BuildProjectParamsDto setContainerPort(String arg) {
		this.containerPort = arg;
		return this;
	}

	public String getJsonParams()

	{
		return this.jsonParams;
	}

	public BuildProjectParamsDto setJsonParams(String arg) {
		this.jsonParams = arg;
		return this;
	}

	public String getServiceMonitor()

	{
		return this.serviceMonitor;
	}

	public BuildProjectParamsDto setServiceMonitor(String arg) {
		this.serviceMonitor = arg;
		return this;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 快速从 dto 转换成 entity
	 * 
	 * @return dto 对应的 entity
	 */
	public BuildProjectParamsDto mapToDto() {
		ObjectMapper toDtoMapper = new ObjectMapper();
		toDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		return toDtoMapper.convertValue(this, BuildProjectParamsDto.class);
	}

	/**
	 * 快速从 entity 转换成 dto
	 * 
	 * @return dto 对应的 entity
	 */
	public BuildProjectParamsDto fromDto(BuildProjectParamsDto entity) {
		ObjectMapper fromDtoMapper = new ObjectMapper();
		fromDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		return fromDtoMapper.convertValue(entity, BuildProjectParamsDto.class);
	}

}
